﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="TopicPosts.aspx.cs" Inherits="Topics_TopicPosts" %>
<%@ Register TagPrefix="uc" TagName="menu" Src="~/Topics/Menu.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phActions" Runat="Server">
    <asp:LinkButton ID="lnkAdd" Text="Add Post" OnClick="lnkAdd_Click" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phSubMenu" Runat="Server">
    <uc:menu ID="menu" runat="server" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="phMain" Runat="Server">
    <script type="text/javascript">
        function addPostClosed(oWnd) {
            if (oWnd && oWnd.argument && oWnd.argument.saved) {
                __doPostBack(lnkAddUniqueId, "");
            }
        }
    </script>
    <ajax:Accordion ID="title" SkinID="Title" runat="server">
        <Panes>
            <ajax:AccordionPane runat="server">
                <Header><asp:Label ID="lblTitle" runat="server" /></Header>
                <Content>
                    <ul class="form">
                        <li><asp:Label AssociatedControlID="lblTopicGroup" Text="Group:" ID="lbl" runat="server" /><asp:Label ID="lblTopicGroup" runat="server" /></li>
                        <li><asp:Label AssociatedControlID="lblNotes" Text="Notes:" ID="Label1" runat="server" /><asp:Label ID="lblNotes" runat="server"/></li>
                    </ul>
                </Content>
            </ajax:AccordionPane>
        </Panes>
    </ajax:Accordion>
    <div class="itemPanel">
        <telerik:RadTabStrip ID="tabSiteVersions"  runat="server" Skin="Black" 
            AutoPostBack="True" ontabclick="tabSiteVersions_TabClick">
        </telerik:RadTabStrip>
        <div class="tabPage">
            <telerik:RadGrid ID="gridPosts" DataSourceID="dsPosts" 
                AutoGenerateColumns="false" AllowPaging="true" runat="server" 
                onitemcommand="gridPosts_ItemCommand">
                <MasterTableView DataKeyNames="Id,ConcurencyId">

<EditFormSettings>
<PopUpSettings ScrollBars="None"></PopUpSettings>
</EditFormSettings>

                    <PagerStyle Mode="Slider" />
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn Visible="False" Resizable="False">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridBoundColumn DataField="ParentPath" HeaderText="Parent Path" />
                        <telerik:GridHyperLinkColumn DataTextField="DisplayName" DataNavigateUrlFormatString="~/Posts/Details.aspx?Id={0}" DataNavigateUrlFields="Id" HeaderText="Display Name" />
                        <telerik:GridBoundColumn DataField="Url" HeaderText="Url" />
                        <telerik:GridButtonColumn Text="Remove" ConfirmTitle="Confirm Remove" ConfirmText="Are you sure you want to remove this post from this topic?" ConfirmDialogType="RadWindow" CommandName="Remove"/>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </div>
    </div>
    <telerik:RadWindowManager ID="winManager" runat="server">
        <Windows>
            <telerik:RadWindow ID="winAdd" Title="Select Post To Add" Behaviors="None" Width="800" Height="600" Modal="true" ShowContentDuringLoad="false" OpenerElementID='<%#lnkAdd.ClientID %>' OnClientClose="addPostClosed" runat="server">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    <telerik:RadAjaxManager ID="ajaxManager" DefaultLoadingPanelID="loading" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="lnkAdd">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridPosts" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="gridPosts">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridPosts" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="tabSiteVersions">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridPosts" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
     <telerik:RadAjaxLoadingPanel ID="loading" InitialDelayTime="0" MinDisplayTime="2" Transparency="50" BackColor="DimGray" runat="server" Height="100%"
        Width="100%">
        <img alt="Loading..." src="../icons/loading1.gif" style="border: 0px;" />
    </telerik:RadAjaxLoadingPanel>
       <acms:PostDataSource ID="dsPosts" runat="server" 
        onselectdata="dsPosts_SelectData"></acms:PostDataSource>
</asp:Content>

